for ii in $(find *.root -type l)
do
    unlink $ii
done

id=$1

mcid=$( expr $id + 50 )

mdir0=$(echo ../../../more_MCjet_10032014/g25finish)
mdir1=$(echo ../../../more_MCjet_10032014/g25finish/Beta22*)

for ii in $(find  ../cmpEta*GrID$id/*/Com* $mdir0/../direct*/*/*direct*id$mcid\.root)
do
    b0=$(basename $ii)
    d0=$(dirname $ii)
    b1=$(basename $d0)
    d1=$(dirname $d0)
    b2=$(basename $d1)

    ff=$b2\_$b1\_$b0
    echo $ii
    ln -s $ii $ff
done


for ii in $(find  $mdir1/cmpEta*GrID$id/*/Com*.root) 
do
    b0=$(basename $ii)
    d0=$(dirname $ii)
    b1=$(basename $d0)
    d1=$(dirname $d0)
    b2=$(basename $d1)

    ff=$b2\_$b1\_$b0
    echo $ii
    ln -s $ii MC$ff
done

#for cmpTheory
for ii in $(find ../_theory/*Com*GrID$id*.root )
do
    b0=$(basename $ii)

    echo $ii
    ln -s $ii

done

exit

#for cmp PWGLF
for ii in $(find /hera/alice/xlu/workspace/hera2dbetabloch/PWGLE_inclusive/Com*GrID$id*.root )
do
    b0=$(basename $ii)

    echo $ii
    ln -s $ii PWGLF$b0

done




#cmpGSI corrected                                                                                                                                                                                                                                            
for ii in $(find /hera/alice/xlu/workspace/hera2dbetabloch/FracFunc_10-d-e/VeryGood_UsedInNote_old/more_datajet_10032014/CorrectedResults/withSc_r2465/cmpEta_TPC1_GrID$id/*/Comb*.root)
do
echo $ii
    ff=$(basename $ii)
    tag=$(basename $(dirname $ii))
    ln -s $ii GSI$tag$ff
done

exit

#cmpGSI
for ii in $(find /hera/alice/xlu/workspace/hera2dbetabloch/FracFunc_10-d-e/VeryGood_UsedInNote/more_datajet_10032014/g25finish/Beta22_r2417-2420/cmpEta_TPC1TOF9_GrID$id/*/Comb*.root)
do
echo $ii
    ff=$(basename $ii)
    tag=$(basename $(dirname $ii))
    ln -s $ii GSI$tag$ff
done

exit

exit

#for cmpTPC
for ii in $(find ../../g25finish/Beta22*/cmpEta*GrID$id/*/Com* )
do
  b0=$(basename $ii)
    d0=$(dirname $ii)
    b1=$(basename $d0)
    d1=$(dirname $d0)
    b2=$(basename $d1)

    ff=$b2\_$b1\_$b0
    echo $ii
    ln -s $ii $ff

done


exit

exit



exit
